<script setup>
import { defineProps } from 'vue';
defineProps({
  title:{
    type: String,
    default: ''
  },
  subTitle: {
    type: String,
    default: ''
  }
})

const emits = defineEmits()

const handleClick = () => {
  emits('greet1', '我草泥马')
  emits('greet2', '我一直草泥马')
}
</script>

<template>
  <div class="home-panel">
    <div class="head" @click="handleClick">
      <!-- 主标题和副标题 -->
      <h3>
        {{ title }}<small>{{ subTitle }}</small>
      </h3>
    </div>
    <!-- 主题内容区域 -->
    <slot name="main" />
  </div>
  <!-- 插槽主题内容模板 -->
  <!-- <ul class="goods-list">
    <li v-for="item in newList" :key="item.id">
      <RouterLink to="/">
        <img :src="item.picture" alt="" />
        <p class="name">{{ item.name }}</p>
        <p class="price">&yen;{{ item.price }}</p>
      </RouterLink>
    </li>
  </ul> -->
</template>
<style scoped lang='less'>
.home-panel {
  background-color: #fff;

  .head {
    padding: 40px 0;
    display: flex;
    align-items: flex-end;

    h3 {
      flex: 1;
      font-size: 32px;
      font-weight: normal;
      margin-left: 6px;
      height: 35px;
      line-height: 35px;

      small {
        font-size: 16px;
        color: #999;
        margin-left: 20px;
      }
    }
  }
}
</style>